<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="com.hackvan2012.datastore.dao.FoodEntryObject" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Yummer</title>
<style type="text/css">
* {
    font-family:"Calibri",Arial,serif;
}

body {
	background-color:#dddddd;
}

#main {
	width:1000px;
	margin: 0px auto;
	border: 1px solid black;
	padding: 10px;
	background-color: white;
}

.title {
	font-size: 15pt;
	font-color: orange;
}
#postButton {
	float:right;
}
.image {
	width: 150px;
	height: 150px;
	float: left;
}

.information {
	float: left;
	padding-left:10px;
}
</style>
<script language="JavaScript" type="text/javascript" src="/js/ajax_vote.js"></script>
</head>
<body>
<div id="main">
	<%
	for (FoodEntryObject foodentry : (List<FoodEntryObject>) request.getAttribute("posts")) {%>
		<div class="post_entry">
		<div class="image"><img src="<%=foodentry.getImgURL() %>" width="150" height="150" alt="" /></div>
		<div class="information">
		<div class="title"><a href="/viewentry?entryId=<%=foodentry.getEntryID()%>"><%=foodentry.getTitle() %></a></div>
		<div class="restaurant">Restaurant: <%=foodentry.getRestaurant() %></div>
		<div class="description">Description: <%=foodentry.getDescription() %></div>
		<div class="dish_name">Dish Name: <%=foodentry.getName() %></div>
		</div>
		<a href="#" onclick="castVote(<%=foodentry.getEntryID() %>);">Vote</a>
		Current vote count: <span id="vote_count_<%=foodentry.getEntryID()%>"><%=foodentry.getVote() %></span>
		<div style="clear:both"></div>
		</div>
		<hr />
	<%}
	%>
	<form method="post" action="/main/new">
		<input id="postButton" type="submit" value="Post a new entry" />
	</form>
	<div style="clear:both"></div>
</div>
</body>
</html>